<%@ page import="cn.edu.zut.model.Reader" %>
<%@ page import="java.util.List" %>
<%@ page import="java.lang.String" %>
<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/6/19/019
  Time: 19:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>读者管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="/js/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="/css/login.css"/>
    <script src="/js/jquery.min.js"></script>
    <script src="/js/bootstrap.min.js"></script>
    <script src="/js/bootstrap-table.min.js"></script>
    <script src="/js/bookstrapreader.js"></script>
    <style type="text/css">
        *{
            margin: 0;
            padding: 0;
        }
        body{
            background-color: white;
        }
        h1{
            background-color: aqua;
        }
        .label{
            background-color: #3BD9FF;
        }
        td{
            text-align: center;
        }
        table{

            background-color: white;
        }
    </style>
</head>
<body>
<h1 align="center">欢迎来到用户管理</h1>
<table class="table table-striped  table-bordered table-condensed" id="table_page1"
       data-pagination="true"
       data-side-pagination="client"
       data-page-size="5">

    <%
        List<Reader> readers= (List <Reader>)session.getAttribute("readers");
        for (Reader reader: readers){
            out.println("<tr>");
            out.println("<td>"+reader.getReaderId()+"</td>");
            out.println("<td>"+reader.getReaderType().getTypeName()+"</td>");
            out.println("<td>"+reader.getName()+"</td>");
            out.println("<td>"+reader.getAge()+"</td>");
            out.println("<td>"+reader.getSex()+"</td>");
            out.println("<td>"+reader.getPhone()+"</td>");
            out.println("<td>"+reader.getDept()+"</td>");
            out.println("<td>"+reader.getRegDate()+"</td>");
            out.println("<td>"+reader.getReaderType().getLimitDay()+"</td>");
            out.println("<td><a href='/readerDelete?id="+reader.getReaderId()+"''>删除</a> | <a href='/jsp/admin/reader/readerModify.jsp?id="+reader.getReaderId()+"&name="+reader.getName()+"'>修改</a></td>");
            out.println("</tr>");
        }
    %>
</table>
<div class="alarm">
    <p style="color: white;text-align: center;font-size: 20px" > ${message }</p>
</div>
</body>
</html>
